package com.zhuchang.self_rpc.test.config;

import org.apache.commons.lang3.StringUtils;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Author RenPu
 * @Date 2021/8/18 15:35
 * @Version 1.0
 * @Description: provider和consumer 抽象出来的超级父类
 **/
public abstract class RpcConfigAbstract {

    private AtomicInteger atomicInteger = new AtomicInteger();

    protected String id;

    protected String InterfaceClass = null;

    //服务的调用方（consumer端，特有的属性）
    protected Class<?> proxyClass = null;


    public String getId() {
        if (StringUtils.isBlank(id)) {
            id = "rapid-cfg-gen-" + atomicInteger.getAndIncrement();
        }
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getInterfaceClass() {
        return this.InterfaceClass;
    }

    public void setInterfaceClass(String interfaceClass) {
        this.InterfaceClass = interfaceClass;
    }

    public Class<?> getProxyClass() {
        return proxyClass;
    }

    public void setProxyClass(Class<?> proxyClass) {
        this.proxyClass = proxyClass;
    }
}
